<template>
    <div style="background-color: darkgoldenrod;">
        <button @click="show=true">听过老爸和我说了SM</button>
        <p v-show="show">老爸说（将要接受父组件传递过来的数据）：{{ toSon }}</p>
        <p v-show="show">那就用成绩来告诉老爸吧：
            <button @click="handle()">feedback</button>
        </p>
        <button @click="show1=true">听听老爸又和我说了SM</button>
        爸爸说：<span :style="{fontSize:getWid}" v-show="show1">棒</span>
        <hr>
        爸爸又说：{{ receiveMsg }}
    </div>
</template>
<script>
export default {
    props:['toSon', 'wid'],
    data() {
        return {
            show:false,
            show1:false,
            score:90,
            receiveMsg:''
        }
    },
    methods: {
        handle() {
            this.$emit('score', this.score)
        },
        receiveMessage(message) {
            this.receiveMsg = message 
        }
    },
    computed:{
        getWid() {
            return this.wid + 'px'
        }
        
    }
}
</script>